using UnityEngine;
using System;

namespace Network 
{
    public class GameConnection : SocketConnection
    {
        public Action connectionDelegate = null;
        public Action disconnectDelegate = null;

        public GameConnection() { Init(); }

        public void Init()
        {
            Reset(false);
        }

        public override void OnConnectSuccess()
        {
            if (connectionDelegate !=null)
            connectionDelegate();
        }

        public override void OnDisconnected()
        {
            Debug.Log("Socket Disconnected");
            if (disconnectDelegate != null)
                disconnectDelegate();
            Mainloop.Instance.ctrl.CurrProc.onTcpDisconnected(); 
        }
    }
}
